// Copyright (c) 2017-2025 Tencent. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v20200721

import (
    tcerr "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/errors"
    tchttp "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/http"
    "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/json"
)

type Conditions struct {
	// Warning condition ID
	// Note: This field may return null, indicating that no valid values can be obtained.
	ConditionId *uint64 `json:"ConditionId,omitnil,omitempty" name:"ConditionId"`

	// Warning level. 2: medium risk; 3: high risk.
	// Note: This field may return null, indicating that no valid values can be obtained.
	Level *uint64 `json:"Level,omitnil,omitempty" name:"Level"`

	// Warning level description
	// Note: This field may return null, indicating that no valid values can be obtained.
	LevelDesc *string `json:"LevelDesc,omitnil,omitempty" name:"LevelDesc"`

	// Warning condition description
	Desc *string `json:"Desc,omitnil,omitempty" name:"Desc"`
}

// Predefined struct for user
type DescribeStrategiesRequestParams struct {

}

type DescribeStrategiesRequest struct {
	*tchttp.BaseRequest
	
}

func (r *DescribeStrategiesRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeStrategiesRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeStrategiesRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DescribeStrategiesResponseParams struct {
	// Assessment item list
	// Note: This field may return null, indicating that no valid values can be obtained.
	Strategies []*Strategies `json:"Strategies,omitnil,omitempty" name:"Strategies"`

	// The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type DescribeStrategiesResponse struct {
	*tchttp.BaseResponse
	Response *DescribeStrategiesResponseParams `json:"Response"`
}

func (r *DescribeStrategiesResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeStrategiesResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DescribeTaskStrategyRisksRequestParams struct {
	// Assessment item ID
	StrategyId *uint64 `json:"StrategyId,omitnil,omitempty" name:"StrategyId"`

	// Quantity of returns. It is 100 by default, and the maximum value is 200.
	Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"`

	// Offset, which is 0 by default.
	Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"`

	// Environment
	Env *string `json:"Env,omitnil,omitempty" name:"Env"`

	// Task type
	TaskType *string `json:"TaskType,omitnil,omitempty" name:"TaskType"`
}

type DescribeTaskStrategyRisksRequest struct {
	*tchttp.BaseRequest
	
	// Assessment item ID
	StrategyId *uint64 `json:"StrategyId,omitnil,omitempty" name:"StrategyId"`

	// Quantity of returns. It is 100 by default, and the maximum value is 200.
	Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"`

	// Offset, which is 0 by default.
	Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"`

	// Environment
	Env *string `json:"Env,omitnil,omitempty" name:"Env"`

	// Task type
	TaskType *string `json:"TaskType,omitnil,omitempty" name:"TaskType"`
}

func (r *DescribeTaskStrategyRisksRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeTaskStrategyRisksRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "StrategyId")
	delete(f, "Limit")
	delete(f, "Offset")
	delete(f, "Env")
	delete(f, "TaskType")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTaskStrategyRisksRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DescribeTaskStrategyRisksResponseParams struct {
	// According to this configuration, match the corresponding fields of the risky instance list (Risks), for example:
	// {"Response":{"RequestId":"111","RiskFieldsDesc":[{"Field":"InstanceId","FieldName":"ID","FieldType":"string","FieldDict":{} },{"Field":"InstanceName","FieldName":"Name","FieldType":"string","FieldDict":{}},{"Field":"InstanceState","FieldName":"Status ","FieldType":"string","FieldDict":{"LAUNCH_FAILED":"Creation failed","PENDING":"Creating","REBOOTING":"Re- starting","RUNNING":"Running","SHUTDOWN":"Stop waiting to be terminated","STARTING":"Starting","STOPPED":"Shut down","STOPPING":"Shutting down"," TERMINATING":"Terminating"}},{"Field":"Zone","FieldName":"Available zone","FieldType":"string","FieldDict":{}},{"Field":" PrivateIPAddresses","FieldName":"Private IP addresses","FieldType":"stringSlice","FieldDict":{}},{"Field":"PublicIPAddresses","FieldName":"Public IP addresses","Field Type":"stringSlice","FieldDict":{}},{"Field":"Region","FieldName":"Region","FieldType":"string","FieldDict":{}},{" Field":"Tags","FieldName":"Tags","FieldType":"tags","FieldDict":{}}],"RiskTotalCount":3,"Risks":"[{\"InstanceId\" :\"ins-xxx1\",\"InstanceName\":\"xxx1\",\"InstanceState\":\"RUNNING\",\"PrivateIPAddresses\":[\"1.17.64.2\"],\ " PublicIPAddresses\":null,\"Region\":\"ap-shanghai\",\"Tags\":null,\"Zone\":\"ap-shanghai-2\"},{\"InstanceId\ ":\"ins-xxx2\",\"InstanceName\":\"xxx2\",\"InstanceState\":\"RUNNING\",\"PrivateIPAddresses\":[\"1.17.64.11\"], \"PublicIPAddresses\":null,\"Region\":\"ap-shanghai\",\"Tags\":null,\"Zone\":\"ap-shanghai-2\"}]"," StrategyId":9}}
	// Note: This field may return null, indicating that no valid values can be obtained.
	RiskFieldsDesc []*RiskFieldsDesc `json:"RiskFieldsDesc,omitnil,omitempty" name:"RiskFieldsDesc"`

	// Assessment item ID
	// Note: This field may return null, indicating that no valid values can be obtained.
	StrategyId *uint64 `json:"StrategyId,omitnil,omitempty" name:"StrategyId"`

	// Number of risky instances
	// Note: This field may return null, indicating that no valid values can be obtained.
	RiskTotalCount *uint64 `json:"RiskTotalCount,omitnil,omitempty" name:"RiskTotalCount"`

	// Risky instance details list. Require json decode.
	// Note: This field may return null, indicating that no valid values can be obtained.
	Risks *string `json:"Risks,omitnil,omitempty" name:"Risks"`

	// Number of inspection resources
	// Note: This field may return null, indicating that no valid values can be obtained.
	ResourceCount *uint64 `json:"ResourceCount,omitnil,omitempty" name:"ResourceCount"`

	// The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type DescribeTaskStrategyRisksResponse struct {
	*tchttp.BaseResponse
	Response *DescribeTaskStrategyRisksResponseParams `json:"Response"`
}

func (r *DescribeTaskStrategyRisksResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeTaskStrategyRisksResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type KeyValue struct {
	// Key name
	Key *string `json:"Key,omitnil,omitempty" name:"Key"`

	// Value corresponding to the key name
	Value *string `json:"Value,omitnil,omitempty" name:"Value"`
}

type RiskFieldsDesc struct {
	// Field ID
	Field *string `json:"Field,omitnil,omitempty" name:"Field"`

	// Field name
	FieldName *string `json:"FieldName,omitnil,omitempty" name:"FieldName"`

	// Field type, 
	// string: String type, such as "aa"
	// int: Integer, for example, 111
	// stringSlice : String array type, such as ["a", "b"]
	// tags: Tag type, for example: [{"Key":"kkk","Value":"vvv"},{"Key":"kkk2","Value":"vvv2"}]
	FieldType *string `json:"FieldType,omitnil,omitempty" name:"FieldType"`

	// Dictionary corresponding to the field value
	// Note: This field may return null, indicating that no valid values can be obtained.
	FieldDict []*KeyValue `json:"FieldDict,omitnil,omitempty" name:"FieldDict"`
}

type Strategies struct {
	// Assessment item ID
	// Note: This field may return null, indicating that no valid values can be obtained.
	StrategyId *uint64 `json:"StrategyId,omitnil,omitempty" name:"StrategyId"`

	// Assessment item name
	// Note: This field may return null, indicating that no valid values can be obtained.
	Name *string `json:"Name,omitnil,omitempty" name:"Name"`

	// Assessment item description
	// Note: This field may return null, indicating that no valid values can be obtained.
	Desc *string `json:"Desc,omitnil,omitempty" name:"Desc"`

	// Product ID corresponding to the assessment item
	// Note: This field may return null, indicating that no valid values can be obtained.
	Product *string `json:"Product,omitnil,omitempty" name:"Product"`

	// Product name corresponding to the assessment item
	// Note: This field may return null, indicating that no valid values can be obtained.
	ProductDesc *string `json:"ProductDesc,omitnil,omitempty" name:"ProductDesc"`

	// Optimization suggestions for the assessment item
	// Note: This field may return null, indicating that no valid values can be obtained.
	Repair *string `json:"Repair,omitnil,omitempty" name:"Repair"`

	// Category ID of the assessment item 
	// Note: This field may return null, indicating that no valid values can be obtained.
	GroupId *uint64 `json:"GroupId,omitnil,omitempty" name:"GroupId"`

	// Category name of the assessment item 
	// Note: This field may return null, indicating that no valid values can be obtained.
	GroupName *string `json:"GroupName,omitnil,omitempty" name:"GroupName"`

	// Risk list of the assessment item 
	// Note: This field may return null, indicating that no valid values can be obtained.
	Conditions []*Conditions `json:"Conditions,omitnil,omitempty" name:"Conditions"`
}